package com.hspedu.newData.力扣周赛.双周赛.第156;

import org.junit.Test;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-10 
 * @Version: 1.0
 */

public class LC100671找到频率最高的元音和辅音 {

    public int maxFreqSum(String s) {

        int[] res = new int[26];

        for (int i = 0; i < s.length(); i++) {
            res[s.charAt(i) - 'a']++;
        }

        int max1 = -1;
        int max2 = -1;

        for (int i = 0; i < 26; i++) {

            if (i==0 || i == 4 || i == 8 || i == 14 || i == 20){
                if (max1 < res[i]){
                    max1 = res[i];
                }
            }else {
                if (max2 < res[i]){
                    max2 = res[i];
                }
            }
        }

        return max1 + max2;
    }

    @Test
    public void test() {
        // 测试代码

        int i = maxFreqSum("successes");
        int i1 = maxFreqSum("aeiaeia");
        System.out.println("111");

    }

}
